import request from '@/utils/axios/axios-service.ts'
import { MenuData } from '@/router/types.ts';

export const login = (data: LoginParam,params:any) => request.post('/v1/client', data,{params:params});
export const logout = (params:any) => request.delete('/v1/client',{params:params});
export const getCaptchaCode = (params:any) => request.get('/v1/captcha',{params:params});
export const getUserInfo = () => request.get('/auth/info');
export const getUserNav = (params:any) => request.get('/v1/client',{params:params})

export interface LoginParam {
  phone: string;
  password: string;
  code: string,
  phrase: string
}

export interface LoginRes {
  header: string;
  token: string;
}

export interface CaptchaCodeRes {
  uuid: string;
  captcha: string;
}

export interface NavDataRes {
  menus: MenuData[];
  permissions: string[];
}
